package Controller.Eboard;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Bean.eboardBean;
import Dao.eboardDao;

public class EboarddetailContoller implements Controller {
	private eboardDao dao;
	public void setDao(eboardDao dao){
		this.dao = dao;
	}

	@Override
	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse arg1) throws Exception {
		eboardBean bean = new eboardBean();
		Integer eb_no = Integer.parseInt(request.getParameter("eb_no"));
		bean.setEb_no(eb_no);
		System.out.println(eb_no+"디테일 컨트롤");
		
		dao.eboardcount(bean);
		
		eboardBean eboarddetail = dao.geteboarddetail(bean);
		
		ModelAndView mav = new ModelAndView();
		mav.addObject("eboarddetail", eboarddetail);
		mav.setViewName("eboarddetail");
		return mav;
		
	}
	
}
